load mnist_def_6;
tsnn = nn;
load mnist_train;
load mnist_test;

tserr = zeros(20,1);
trerr = zeros(20,1);

tserr(1) = calerr(Yl(tsnn(1,:)),Yu);

for i = 2:20
    Yts = mode(Yl(tsnn(1:i,:)),1);
    tserr(i) = calerr(Yts',Yu);
end
x = 1:20;
plot(x,tserr)